package com.tt.fashionWebSite.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 10520_000 on 11/2/14.
 */
public class ChiTietSanPhamFullDto implements Serializable {
   private String maCTSP;
   private MauSacDto mauSac;
   private KichThuocDto kichThuoc;
   private HoaTietDto hoaTiet;
   private Double giaSP;
   private Long soLuong;
   private String maSP;
   private List<ChiTietKhuyenMaiFullDto> chiTietKhuyenMai;
   private List<HinhAnhSanPhamDto> hinhAnhSanPham;

   public ChiTietSanPhamFullDto() {

   }

   public ChiTietSanPhamFullDto(Object[] chiTietSanPhamInfo) {
      if (chiTietSanPhamInfo[0] != null) {
         this.maCTSP = (String) chiTietSanPhamInfo[0];
      }

      this.mauSac = new MauSacDto();
      if(chiTietSanPhamInfo[1] != null) {
         this.mauSac.setMaMau(chiTietSanPhamInfo[1].toString());
      }

      if(chiTietSanPhamInfo[2] != null) {
         this.mauSac.setTenMau(chiTietSanPhamInfo[2].toString());
      }

      this.kichThuoc = new KichThuocDto();
      if(chiTietSanPhamInfo[3] != null) {
         this.kichThuoc.setMaSize(chiTietSanPhamInfo[3].toString());
      }

      if(chiTietSanPhamInfo[4] != null) {
         this.kichThuoc.setTenSize(chiTietSanPhamInfo[4].toString());
      }

      this.giaSP = Double.valueOf(chiTietSanPhamInfo[5].toString());
      this.soLuong = Long.valueOf(chiTietSanPhamInfo[6].toString());

      this.hoaTiet = new HoaTietDto();
      if(chiTietSanPhamInfo[3] != null) {
         this.hoaTiet.setMaHoaTiet(chiTietSanPhamInfo[7].toString());
      }

      if(chiTietSanPhamInfo[4] != null) {
         this.hoaTiet.setTenHoaTiet(chiTietSanPhamInfo[8].toString());
      }

      chiTietKhuyenMai = new ArrayList<ChiTietKhuyenMaiFullDto>();
      hinhAnhSanPham = new ArrayList<HinhAnhSanPhamDto>();
   }

   public String getMaCTSP() {
      return maCTSP;
   }

   public void setMaCTSP(String maCTSP) {
      this.maCTSP = maCTSP;
   }

   public MauSacDto getMauSac() {
      return mauSac;
   }

   public void setMauSac(MauSacDto mauSac) {
      this.mauSac = mauSac;
   }

   public KichThuocDto getKichThuoc() {
      return kichThuoc;
   }

   public void setKichThuoc(KichThuocDto kichThuoc) {
      this.kichThuoc = kichThuoc;
   }

   public HoaTietDto getHoaTiet() {
      return hoaTiet;
   }

   public void setHoaTiet(HoaTietDto hoaTiet) {
      this.hoaTiet = hoaTiet;
   }

   public Double getGiaSP() {
      return giaSP;
   }

   public void setGiaSP(Double giaSP) {
      this.giaSP = giaSP;
   }

   public Long getSoLuong() {
      return soLuong;
   }

   public void setSoLuong(Long soLuong) {
      this.soLuong = soLuong;
   }

   public String getMaSP() {
      return maSP;
   }

   public void setMaSP(String maSP) {
      this.maSP = maSP;
   }

   public List<ChiTietKhuyenMaiFullDto> getChiTietKhuyenMai() {
      return chiTietKhuyenMai;
   }

   public void setChiTietKhuyenMai(List<ChiTietKhuyenMaiFullDto> chiTietKhuyenMai) {
      this.chiTietKhuyenMai = chiTietKhuyenMai;
   }

   public List<HinhAnhSanPhamDto> getHinhAnhSanPham() {
      return hinhAnhSanPham;
   }

   public void setHinhAnhSanPham(List<HinhAnhSanPhamDto> hinhAnhSanPham) {
      this.hinhAnhSanPham = hinhAnhSanPham;
   }
}
